package com.crm.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.crm.pojo.domain.Activity;
import com.crm.pojo.domain.Channel;
import com.crm.pojo.vo.ActivityListVo;
import lombok.Data;
import org.apache.ibatis.annotations.Mapper;

import java.time.LocalDateTime;
import java.util.Date;
import java.util.List;

@Mapper
public interface ActivityMapper extends BaseMapper<Activity> {

    /**
     * 活动分页查询总数
     * @param params
     * @return
     */
    Long listCount(String code, String channel, LocalDateTime beginTime, LocalDateTime endTime,
                   LocalDateTime beginCreateTime, LocalDateTime endCreateTime);

    /**
     * 活动列表分页查询
     * @param startIndex
     * @param pageSize
     * @return
     */
    List<ActivityListVo> selList(int startIndex, Integer pageSize,
                                 String code, String channel, LocalDateTime beginTime, LocalDateTime endTime,
                                 LocalDateTime beginCreateTime, LocalDateTime endCreateTime);

    /**
     * 渠道查询
     * @return
     */
    List<Channel> selChannel();

    /**
     * 新增活动
     * @param activity
     */
    void insertActivity(Activity activity);

    /**
     * 修改活动
     * @param activity
     */
    void updateActivity(Activity activity);

    /**
     * 回显一个活动数据
     * @param id
     * @return
     */
    Activity selOne(Integer id);

    /**
     * 删除活动
     * @param id
     */
    void delActivity(Integer id);


}
